<section id="main-body" style='margin-top: 110px;'>
	<div class="container">
		<div class="row">
			<div class="col-md-9 col-sm-12">
				<div class="box-title-page">
					<h4><?php echo $detail['r_name']; ?></h4>
				</div>
				<div class="row">
					<div class="col-md-12 col-sm-12">
						<div class="box-event-page-detail">
							<?php $url = site_url('recipes/detail/'.slugify($detail['r_name']).'/'.$detail['r_id']); ?>
							<div style='float:left;padding-left:10px;padding-top:5px;'>
								<h4><?php echo date("d F, Y", strtotime($detail['r_created_date'])); ?></h4>
							</div>
							<div class="rating-in-detail" id="rating-recipes">
								<a href="#" id="<?php echo $detail['r_id']; ?>">
									<?php $rating = $this->rm->show_rating($detail['r_id']); echo $rating; ?>
								</a>
								<div class="message" style="float:right; margin-left:10px;"></div>
							</div>
							<div style='float:right;'>
								<ul class="socmed">
									<li class="facebook"><a title="Share on Facebook" target="_blank" href="http://www.facebook.com/share.php?u=<?php echo $url;?>"><i class="fa fa-facebook"></i></a></li>
									<li class="twitter"><a title="Share on Twitter" target="_blank" href="http://twitter.com/share?text=<?php echo $detail['r_name'];?>&url=<?php echo $url;?>"><i class="fa fa-twitter"></i></a></li>
									<li class="google"><a title="Share on Google+" target="_blank" href="https://plusone.google.com/_/+1/confirm?url=<?php echo $url;?>"><i class="fa fa-google-plus"></i></a></li>
								</ul>
							</div>							
							<div style="clear:both;"></div>
							<div id="oemah-sliders-products" class="owl-carousel owl-theme-2">
							  <div class="item">
						  		<center>
									<?php if(!empty($detail['r_filename'])): ?>
									<img class="img-responsive" src="<?php echo site_url('recipes/appimage/recipes/'.$detail['r_filename']); ?>" alt="<?php echo $detail['r_fileorig']; ?>">
									<?php else: ?>
									<img class="img-responsive" src="<?php echo site_url('recipes/themeimage/logo.png'); ?>" alt="Haan Kreasi Ibu Juara">
									<?php endif; ?>
								</center>
							  </div>
							</div>
							<div class="description">
								<?php echo $detail['r_desc'];?>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12 col-sm-12">
						<h2 class="page-header">Comments</h2>
						<form class="form-horizontal" action="<?php echo site_url('recipes/do_comment'); ?>" method="post">
							<input type="hidden" name="r_id" value="<?php echo $detail['r_id']; ?>">
							<input type="hidden" name="r_name" value="<?php echo $detail['r_name']; ?>">
							<div class="form-group">
								<label for="fullname" class="col-sm-4 control-label">Nama Lengkap</label>
								<div class="col-sm-8">
									<input type="text" class="form-control" placeholder="Nama Lengkap" name="cr_fullname">
								</div>
							</div>
							<div class="form-group">
								<label for="email" class="col-sm-4 control-label">email</label>
								<div class="col-sm-8">
									<input type="email" class="form-control" placeholder="email" name="cr_email">
								</div>
							</div>
							<div class="form-group">
								<label for="comment" class="col-sm-4 control-label">Comment</label>
								<div class="col-sm-8">
									<textarea name="ca_comments" class="form-control"></textarea>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-offset-4 col-sm-8">
									<?php echo $recaptcha_html; ?>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-offset-10 col-sm-2">
									<input type="submit" class="btn btn-default" name="submit" value="Submit">
								</div>
							</div>
						</form>
						<h2 class="page-header">&nbsp;</h2>
						<section class="comment-list">
							<!-- First Comment -->
							<?php if(isset($comments)): $currentRow = 1; foreach ($comments as $comm ): ?>
								<?php if($currentRow % 2 == 0): ?>
								<article class="row">
									<div class="col-md-10 col-sm-10">
										<div class="panel panel-default arrow right">
											<div class="panel-body">
												<header class="text-left">
												<div class="comment-user"><i class="fa fa-user"></i> <?php echo $comm->cr_fullname; ?></div>
												<time class="comment-date" datetime="<?php echo $comm->cr_created_date; ?>"><i class="fa fa-clock-o"></i> <?php echo date("M d, Y", strtotime($comm->cr_created_date)); ?></time>
												</header>
												<div class="comment-post">
												<p><?php echo $comm->cr_comments; ?></p>
												</div>
											</div>
										</div>
									</div>

									<div class="col-md-2 col-sm-2 hidden-xs">
										<figure class="thumbnail">
											<img class="img-responsive" src="<?php echo site_url('articles/themeimage/logo.png'); ?>" />
											<figcaption class="text-center"><?php echo $comm->cr_fullname; ?></figcaption>
										</figure>
									</div>
								</article>
								<?php else: ?>
								<article class="row">
									<div class="col-md-2 col-sm-2 hidden-xs">
										<figure class="thumbnail">
											<img class="img-responsive" src="<?php echo site_url('articles/themeimage/logo.png'); ?>" />
											<figcaption class="text-center"><?php echo $comm->cr_fullname; ?></figcaption>
										</figure>
									</div>
								
									<div class="col-md-10 col-sm-10">
										<div class="panel panel-default arrow left">
											<div class="panel-body">
												<header class="text-left">
												<div class="comment-user"><i class="fa fa-user"></i> <?php echo $comm->cr_fullname; ?></div>
												<time class="comment-date" datetime="<?php echo $comm->cr_created_date; ?>"><i class="fa fa-clock-o"></i> <?php echo date("M d, Y", strtotime($comm->cr_created_date)); ?></time>
												</header>
												<div class="comment-post">
												<p><?php echo $comm->cr_comments; ?></p>
												</div>
											</div>
										</div>
									</div>
								</article>
								<?php endif; ?>
							<?php $currentRow++; endforeach; endif; ?>
						</section>
					</div>
				</div>
			</div>

			<div class="col-md-3 col-sm-12">
				<div class="list-group">
					<a href="#" class="list-group-item active">
						<i class="fa fa-file-o"></i> Categories Recipes
					</a>
					<?php if(isset($categories)): foreach ($categories as $cat): ?>
						<a href="<?php echo site_url('recipes/categories/'.$cat->cr_id); ?>" class="list-group-item">
							<i class="fa fa-file"></i> <?php echo $cat->cr_name; ?>
						</a>	
					<?php endforeach; endif; ?>
				</div>
				<div class="bs-example">
				    <div class="list-group">
				        <a href="#" class="list-group-item active">
				            <span class="glyphicon glyphicon-file"></span> Recent Article
				        </a>
				        <?php if(isset($recent_articles)): foreach ($recent_articles as $articles): ?>
							<a href="<?php echo site_url('articles/detail/'.$articles->a_title.'/'.$articles->a_id); ?>" class="list-group-item">
								<i class="fa fa-gift"></i> <?php echo $articles->a_title; ?>
							</a>	
						<?php endforeach; endif; ?>
				    </div>
				</div>
				<div class="bs-example">
				    <div class="list-group">
				        <a href="#" class="list-group-item active">
				            <span class="glyphicon glyphicon-file"></span> Recent Products
				        </a>
				        <?php if(isset($recent_products)): foreach ($recent_products as $products): ?>
							<a href="<?php echo site_url('products/detail/'.slugify($products->p_name).'/'.$products->p_id); ?>" class="list-group-item">
								<i class="fa fa-gift"></i> <?php echo $products->p_name; ?>
							</a>	
						<?php endforeach; endif; ?>
				    </div>
				</div>
				<div style='margin-top:10px;margin-bottom:10px;'>
					<?php
						if(isset($widget_home)): foreach ($widget_home as $widget): 
							if ($widget->widget_place == 1)	echo $widget->widget_source;
						endforeach; endif; 
					?>
				</div>
			</div>
		</div>
	</div>
</section>

